import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login.vue'
import Main from '@/views/Main.vue'

Vue.use(VueRouter)

const routes = [{
		path: '/',
		redirect: '/login'
	},
	{
		path: '/login',
		name: 'login',
		component: Login
	},
	{
		path: '/main',
		component: Main,
		children: [{
				path: '/',
				redirect: '/home'
			},
			{
				path: '/home',
				name: 'home',
				component: () => import('@/views/Home.vue')
			},
			{
				path: '/community',
				name: 'community',
				component: () => import('@/views/Community.vue')
			},
			{
				path: '/store',
				name: 'store',
				component: () => import('@/views/Store.vue')
			},
			{
				path: '/courier',
				name: 'courier',
				component: () => import('@/views/Courier.vue')
			},
			{
				path: '/goods',
				name: 'goods',
				component: () => import('@/views/Goods.vue')
			},
			{
				path: '/domestic',
				name: 'domestic',
				component: () => import('@/views/Domestic.vue')
			}
		]
	}

	// {
	// 	path: '/',
	// 	name: 'home',
	// 	component: HomeView
	// },
	// {
	// 	path: '/about',
	// 	name: 'about',
	// 	component: () => import( /* webpackChunkName: "about" */ '../views/AboutView.vue')
	// }
]

const router = new VueRouter({
	routes
})

export default router